<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('培养计划')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>培养计划：</p>
                            <input type="text" name="planName"/>
                        </li>
                        <li>
                            <p>专业：</p>
                            <input type="text" name="profession"/>
                        </li>
                        <li>
                            <p>版本：</p>
                            <input type="text" name="version"/>
                        </li>
                        <li class="select-time">
                            <p>生效时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginEffectiveTime"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endEffectiveTime"/>
                        </li>
                        <li>
                            <p>总分数：</p>
                            <input type="text" name="totalScores"/>
                        </li>
                        <li>
                            <p>总学时：</p>
                            <input type="text" name="totalTime"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('website:train:edit')}]];
    // var removeFlag = [[${@permission.hasPermi('website:kaikecheck:remove')}]];
    var prefix = ctx + "website/train";

    $(function() {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "edit/{id}",
            modalName: "培养计划",
            columns: [{
                checkbox: true
            },
                {
                    field : 'id',
                    title : '序号',
                    visible: true,
                    formatter: function (value, row, index) {
                        console.log(value);
                        console.log(row);
                        console.log(index);
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field : 'planName',
                    title : '培养计划名称'
                },
                {
                    field : 'profession',
                    title : '专业'
                },
                {
                    field : 'version',
                    title : '版本'
                },
                {
                    field : 'effectiveTime',
                    title : '生效时间'
                },
                {
                    field : 'totalScores',
                    title : '总分数'
                },
                {
                    field : 'totalTime',
                    title : '总学时'

                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function edit(val) {
        // console.log(val);
        $.modal.openTab('培养计划查看',ctx+'website/train/edit/'+val);
    }
</script>
</body>